<!DOCTYPE html>
<html>
<head>
<title>后台担保公司开户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">

<script type="text/javascript">
	var dataGrid;
	var winWidth =  800;
	var winHeight = 500;
	var addTitle = "添加担保公司"; //添加窗口标题
	var addUrl =  "/modules/user/user/user/userAdminAddPage.html"; // 添加窗口链接地址
	var lockTitle = "锁定用户";
	var lockUrl =  "/modules/user/user/user/userAdminLockPage.html";
	var lockWinParmeters = "'{0}','"+lockTitle+"',500,300,'"+lockUrl+"','确定'";
	var editTitle = "修改担保公司信息";
	var editUrl =  "/modules/user/user/user/userAdminEditPage.html?userNature=3";
	var editParmeters = "'{0}','"+editTitle+"',"+winWidth+","+winHeight+",'"+editUrl+"','确定'";
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'userAdminList.html?userNature=3',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'asc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [
			{ field: 'id', title: '编号', width: 50, checkbox : false},
			{ field: 'companyName', title: '公司名称', width: 100, sortable: false },
			{ field: 'address', title: '公司地址', width: 100, sortable: false },
			{ field: 'city', title: '所在城市', width: 100, sortable: false },
			{ field: 'companyRegNo', title: '营业执照号', width: 120, sortable: false },
			{ field: 'taxRegNo', title: '税务登记证号', width: 120, sortable: false },
			{ field: 'zzjgCode', title: '组织机构代码', width: 120, sortable: false },
			{ field: 'frdbName', title: '公司法人', width: 100, sortable: false },
			{ field: 'status', title: '锁定状态', width: 100, sortable: false, formatter: function(value,row,index){
				if (value == 0){
					return "未锁定";
				} else {
					return "锁定";
				}
            } }, 
			{	field : 'action',
				title : '操作',
				width :80,
				fixed :true,
				formatter : function(value, row, index) {
					var str = '';
					str += $.formatString('<img onclick="$.fn.dataGridOptions.editFun('+lockWinParmeters+');" src="{1}" title="锁定用户"/>', row.id, '${theme_dir}/css/images/extjs_icons/lock/lock.png');
					str += '&nbsp;';
					str += $.formatString('<img onclick="$.fn.dataGridOptions.editFun('+editParmeters+');" src="{1}" title="修改用户"/>', row.id, '${theme_dir}/css/images/extjs_icons/pencil.png');
					str += '&nbsp;';
					if (!row.emailStatus) {
						str += $.formatString('<img onclick="email_retry('+row.id+')" class="email_retry'+row.id+'" src="{1}" title="重新发送"/>', row.id, '${theme_dir}/css/images/extjs_icons/email/email_go.png');
					} 
					str += '&nbsp;';
					return str;
				}
			} ] ],
			toolbar : '#toolbar',
			
		});
	});
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
            <div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="输入公司名称/法人代表姓名进行搜索" /><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
                                    <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
            <div class="sRight">
            	<a onclick="$.fn.dataGridOptions.addFun(3,addTitle,winWidth,winHeight,addUrl);" href="javascript:void(0);" class="addBtn">添加</a>		
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
		       		<li><span>公司名称</span><input type="text" name="companyName" autocomplete="off"/></li>
		       		<li><span>法人代表姓名</span><input type="text" name="frdbName" autocomplete="off"/></li>
		       		<li><span>状态</span><select name="status" class="type">
	                  <option value="99" selected="selected">全部</option>
	                  <option value="0">未锁定</option>
	                  <option value="1">锁定</option>
	                </select></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
        </div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
	<script>
	function email_retry(id){
		$.ajax({
			type:"post",
			url:"/modules/user/user/user/sendMail.html?id=" + id + "&randomTime=" + (new Date()).getTime(),
			dataType:"json",
			success:function(data){
				parent.$.messager.alert('提示','发送成功', 'info');
			}

		});
	}
	</script>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>
